<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!--WARNING: This file is maintained by ROO! IT WILL BE OVERWRITTEN unless you specify null	@RooWebScaffold(automaticallyMaintainView = false) in the governing controller-->
<jsp:directive.include file="/WEB-INF/jsp/includes.jsp"/>
<jsp:directive.include file="/WEB-INF/jsp/header.jsp"/>
<script type="text/javascript">dojo.require("dijit.TitlePane");</script>
<div dojoType="dijit.TitlePane" style="width: 100%" title="List all stories">
    <c:if test="${not empty stories}">
        <table width="500px">
            <tr>
                <thead>
                    <th>Id</th>
                    <th>Estimate</th>
                    <th>Description</th>
                    <th>Tasks</th>
                    <th>Theme</th>
                    <th>Comments</th>
                    <th/>
                    <th/>
                    <th/>
                </thead>
            </tr>
            <c:forEach items="${stories}" var="story">
                <tr>
                    <td>${story.id}</td>
                    <td>${story.estimate}</td>
                    <td>${fn:substring(story.description, 0, 10)}</td>
                    <td>${fn:length(story.tasks)}</td>
                    <td>${fn:substring(story.theme.title, 0, 10)}</td>
                    <td>${fn:length(story.comments)}</td>
                    <td>
                        <form:form action="/yourscrum/story/${story.id}" method="GET">
                            <input alt="Show story" src="/yourscrum/static/images/show.png" title="Show story" type="image" value="Show story"/>
                        </form:form>
                    </td>
                    <td>
                        <form:form action="/yourscrum/story/${story.id}/form" method="GET">
                            <input alt="Update story" src="/yourscrum/static/images/update.png" title="Update story" type="image" value="Update story"/>
                        </form:form>
                    </td>
                    <td>
                        <form:form action="/yourscrum/story/${story.id}" method="DELETE">
                            <input alt="Delete story" src="/yourscrum/static/images/delete.png" title="Delete story" type="image" value="Delete story"/>
                        </form:form>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </c:if>
    <c:if test="${empty stories}">No stories found.</c:if>
</div>
<jsp:directive.include file="/WEB-INF/jsp/footer.jsp"/>
